#%RAML 0.8
title: Simple Light
version: v1.0-20150910
schemas:
  - LightSchema: !include simple-light.json
    LightSchemaError: !include simple-light-error.json

/sample/light:
  description: Resource to be exposed by any Simple Device that can act as Light.
  displayName: Simple Light
  get:
    responses:
      200:
        body:
          application/json:
            schema: LightSchema
            example: |
              {
                "resourceType": "sample.light",
                "power":  "off"
              }
  put:
    body:
      application/json:
        schema: LightSchema
        example: |
          {
            "power":  "off",
            "intensity": 5
          }
    responses:
      200:
        body:
          application/json:
            schema: LightSchema
            example: |
              {
                "power":  "off",
                "intensity": 5
              }
      403:
        description: |
          This response is generated by the Server when the client sends:
            An update with an out of range property value for intensity.
          The server responds with the range property illustrating the error.
        body:
          application/json:
            schema: LightSchemaError
            example: |
              {
                "range":  "1,20"
              }
  post:
    body:
      application/json:
        schema: LightSchema
        example: |
          {
            "power":  "off"
          }
    responses:
      200:
        body:
          application/json:
            schema: LightSchema
            example: |
              {
                "power":  "off"
              }
      403:
        description: |
          This response is generated by the Server when the client sends:
            An update with an out of range property value for intensity.
          The server responds with the range property illustrating the error.
        body:
          application/json:
            schema: LightSchemaError
            example: |
              {
                "range":  "1,20"
              }
